package com.ruoyi.faceplus.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.faceplus.mapper.FaceRecognitionMapper;
import com.ruoyi.faceplus.domain.FaceRecognition;
import com.ruoyi.faceplus.service.IFaceRecognitionService;

/**
 * 人脸识别库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-17
 */
@Service
public class FaceRecognitionServiceImpl implements IFaceRecognitionService 
{
    @Autowired
    private FaceRecognitionMapper faceRecognitionMapper;

    /**
     * 查询人脸识别库
     * 
     * @param id 人脸识别库主键
     * @return 人脸识别库
     */
    @Override
    public FaceRecognition selectFaceRecognitionById(Long id)
    {
        return faceRecognitionMapper.selectFaceRecognitionById(id);
    }

    /**
     * 查询人脸识别库列表
     * 
     * @param faceRecognition 人脸识别库
     * @return 人脸识别库
     */
    @Override
    public List<FaceRecognition> selectFaceRecognitionList(FaceRecognition faceRecognition)
    {
        return faceRecognitionMapper.selectFaceRecognitionList(faceRecognition);
    }

    /**
     * 新增人脸识别库
     * 
     * @param faceRecognition 人脸识别库
     * @return 结果
     */
    @Override
    public int insertFaceRecognition(FaceRecognition faceRecognition)
    {
        faceRecognition.setCreateTime(DateUtils.getNowDate());
        return faceRecognitionMapper.insertFaceRecognition(faceRecognition);
    }

    /**
     * 修改人脸识别库
     * 
     * @param faceRecognition 人脸识别库
     * @return 结果
     */
    @Override
    public int updateFaceRecognition(FaceRecognition faceRecognition)
    {
        faceRecognition.setUpdateTime(DateUtils.getNowDate());
        return faceRecognitionMapper.updateFaceRecognition(faceRecognition);
    }

    /**
     * 批量删除人脸识别库
     * 
     * @param ids 需要删除的人脸识别库主键
     * @return 结果
     */
    @Override
    public int deleteFaceRecognitionByIds(Long[] ids)
    {
        return faceRecognitionMapper.deleteFaceRecognitionByIds(ids);
    }

    /**
     * 删除人脸识别库信息
     * 
     * @param id 人脸识别库主键
     * @return 结果
     */
    @Override
    public int deleteFaceRecognitionById(Long id)
    {
        return faceRecognitionMapper.deleteFaceRecognitionById(id);
    }
}
